﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace CoreShop.Model
{
    /// <summary>
    /// 前台下单表
    /// </summary>
    public partial class corecmsfoodordering
    {
        /// <summary>
        /// Id号
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public Int64 id { get; set; }

        /// <summary>
        /// 序号
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "rowId", IsNullable = true)]
        public Int32 rowId { get; set; }

        /// <summary>
        /// 订单id
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "orderId", IsNullable = true)]
        public Int64 orderId { get; set; }

        /// <summary>
        /// 商品Id
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "foodId", IsNullable = true)]
        public Int64 foodId { get; set; }

        /// <summary>
        /// 规格Id
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "foodSpecId", IsNullable = true)]
        public Int64 foodSpecId { get; set; }

        /// <summary>
        /// 商品条码
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "code", IsNullable = false)]
        public String code { get; set; }
        /// <summary>
        /// 商品编码
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "number", IsNullable = false)]
        public String number { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "name", IsNullable = false)]
        public String name { get; set; }

        /// <summary>
        /// 规格名称
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "specName", IsNullable = false)]
        public String specName { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "unitName", IsNullable = false)]
        public String unitName { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "quantity", Length = 10, DecimalDigits = 3)]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "数量必须在-99999999到99999999之间")]
        public Decimal quantity { get; set; }

        /// <summary>
        /// 原价
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "price")]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "单价必须在-99999999到99999999之间")]
        public Decimal price { get; set; }

        /// <summary>
        /// 实价
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "realPrice")]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "实价必须在-99999999到99999999之间")]
        public Decimal realPrice { get; set; }


        /// <summary>
        /// 折扣
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "discount")]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "折扣必须在-99999999到99999999之间")]
        public Decimal discount { get; set; }

        /// <summary>
        /// 原金额
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "amount", ColumnDescription = "金额",Length = 10, DecimalDigits = 2)]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "金额必须在-99999999到99999999之间")]
        public Decimal amount { get; set; }

        /// <summary>
        /// 实收金额
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "realAmount", Length = 10, DecimalDigits = 2)]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "金额必须在-99999999到99999999之间")]
        public Decimal realAmount { get; set; }

        /// <summary>
        /// 做法金额
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "taskAmount", Length = 10, DecimalDigits = 2)]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "做法金额必须在-99999999到99999999之间")]
        public Decimal taskAmount { get; set; }

        /// <summary>
        /// 加料金额
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "feedAmount", Length = 10, DecimalDigits = 2)]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "加料金额必须在-99999999到99999999之间")]
        public Decimal feedAmount { get; set; }

        /// <summary>
        /// 源价，保存折扣，赠送等前的realPrice价
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "sourcePrice", Length = 10, DecimalDigits = 4)]
        public Decimal sourcePrice { get; set; }


        /// <summary>
        /// 小计
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "allAmount", Length = 10, DecimalDigits = 2)]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "小计必须在-99999999到99999999之间")]
        public Decimal allAmount { get; set; }

        /// <summary>
        /// 商品类型(1.普通菜；2.套菜；3.线下临时菜；4.临时套菜，
        /// 5.套菜内商品,6分组主菜,7分组配菜)--corecmsfood.type                    
        /// 分组主菜
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "itemType")]
        public Int32 itemType { get; set; }

        /// <summary>
        /// 商品数(1商品，0套菜)
        /// 因为计算商品数，所以不能有其它数值
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "itemCount")]
        public Int32 itemCount { get; set; }

        /// <summary>
        /// 销售类型(-1退货，0赠送,1正常，2打折，3促销)
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "dataType")]
        public Int32 dataType { get; set; }

        /// <summary>
        /// 叫起标记(0默认，1叫起，2起菜，3划菜)
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "callType")]
        public Int32 callType { get; set; } = 0;

        /// <summary>
        /// 打包标记
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "parcel", IsNullable = true)]
        public String parcel { get; set; }


        /// <summary>
        /// 做法名称
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "taskTitle", IsNullable = true)]
        public String taskTitle { get; set; }

        /// <summary>
        /// 加料名称
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "feedTitle", IsNullable = true)]
        public String feedTitle { get; set; }

        /// <summary>
        /// 商品状态(0待下单,1已下单)
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "itemStatus", IsNullable = true)]
        public Int32 itemStatus { get; set; }

        /// <summary>
        /// 餐套主菜Id
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "foodPackId", IsNullable = true)]
        public Int64 foodPackId { get; set; }

        /// <summary>
        /// 原Id,corecmsfoodordering.sourceId=corecmsfoodordering.sourceId)
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "sourceId", IsNullable = true)]
        public Int64 sourceId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "remark", IsNullable = true)]
        public String remark { get; set; }

        /// <summary>
        /// 商品分类Id
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "foodTypeId", IsNullable = true)]
        public Int64 foodTypeId { get; set; }

        /// <summary>
        /// 批次Id
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "batchId", IsNullable = true)]
        public Int64 batchId { get; set; }

        /// <summary>
        /// 最低折扣
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "minDiscount", IsNullable = true)]
        public Decimal minDiscount { get; set; } = 0;

        /// <summary>
        /// 套菜内品执行价格
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "setPrice")]
        public Decimal? setPrice { get; set; } = 0;

        /// <summary>
        /// 套餐数量
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "foodPackQuantity")]
        public Decimal foodPackQuantity { get; set; }

        /// <summary>
        /// 购买限制数量
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "limitBuyQty")]
        public Decimal limitBuyQty { get; set; }

        /// <summary>
        /// 下单人Id
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "billerId", IsNullable = true)]
        public long billerId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "createTime", IsNullable = true)]
        public DateTime createTime { get; set; }

        /// <summary>
        /// 免打厨房单
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "unPrint")]
        public bool? unPrint { get; set; } = false;

        /// <summary>
        /// 最低价
        /// </summary>
        [SugarColumn(ColumnDescription = "最低价", DecimalDigits = 4, IsNullable = true)]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "最低价必须在-99999999到99999999之间")]
        public System.Decimal minPrice { get; set; }

        /// <summary>
        /// 最高价
        /// </summary>
        [SugarColumn(ColumnDescription = "最高价", DecimalDigits = 4, IsNullable = true)]
        [Range(-99999999.00, 99999999.00, ErrorMessage = "最高价必须在-99999999到99999999之间")]
        public System.Decimal maxPrice { get; set; }

        /// <summary>
        /// 是否可以打折
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "disItem", IsNullable = false)]
        public bool disItem { get; set; }

        /// <summary>
        /// 有效天数
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "periodDay")]
        public Int32 periodDay { get; set; }
    }
}
